package com.songcha.library_business.helper

import com.songcha.library_common.util.DateUtil
import com.songcha.library_picker.pickerview.utils.LunarDateUtil

class AlmanacLunarHelper {
    companion object{
        @JvmStatic
        fun getLunarInfo(year:Int,month:Int,day:Int):List<String>{
            val lunarArr = LunarDateUtil.calLunar(year, month, day)
            val calendar = DateUtil.yearMonthDay2Calendar(year, month, day)

            val animal = LunarDateUtil.AnimalsYear(lunarArr[0])
            val isLeap = LunarDateUtil.leapMonth(year) == lunarArr[1]
            val lunarMonth = LunarDateUtil.getLunarMonth(year, lunarArr[1], isLeap)
            val lunarDay = LunarDateUtil.getChinaDayDate(lunarArr[2])
            val lunarGanZhiYear = LunarDateUtil.getLunarYearText(lunarArr[0])
            val lunarGanZhiMonth = LunarDateUtil.cyclicalm(lunarArr[4]) + "月"
            val lunarGanZhiDay = LunarDateUtil.cyclicalm(lunarArr[5]) + "日"
            val dayOfWeek = DateUtil.getDayOfWeekByCalendar(calendar)
            val weekOfYear = DateUtil.getWeekOfYearByCalendar(calendar)

            val info = listOf(animal,lunarMonth,lunarDay,
                lunarGanZhiYear,lunarGanZhiMonth,lunarGanZhiDay,
                weekOfYear.toString(),dayOfWeek)
            return info
        }
    }

}